<!DOCTYPE html>
<html>

	<head>
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<script src="../../js/mui.min.js"></script>
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<script src="../../js/getURLParam.js"></script>
		<link rel="stylesheet" type="text/css" href="../../css/app.css"/>
		<meta charset="utf-8">
	</head>

	<body>
		<div class="headerstyle" id="closeIsLoading" style="background-color:#efeff4;text-align: center;">
				<span  style="color:black"><img src="../../images/loading.gif" style="vertical-align:middle"/>正在加载...</span>
		</div>
        <div class="mui-content" id="getCarOemList">
        	
		</div>
	</body>
	<script type="text/javascript" charset="utf-8">
			//mui初始化 
			mui.init({
				 gestureConfig:{
				   tap: true, //默认为true
				   doubletap: false, //默认为false
				   longtap: true, //默认为false
			  	}
			});
			//准备好之后开始加载数据
			var sessionid=GetQueryString("sessionid");
	        var accountid=GetQueryString("accountid");
	        var proversion=GetQueryString("proversion");
	        (function($){
			  	nowDate=getNowFormatDate();
			  	getCarOemList();
			  })(mui);
			  function getNowFormatDate() {
			    var date = new Date();
			    var seperator1 = "-";
			    var seperator2 = ":";
			    var month = date.getMonth() + 1;
			    var strDate = date.getDate();
			    if (month >= 1 && month <= 9) {
			        month = "0" + month;
			    }
			    if (strDate >= 0 && strDate <= 9) {
			        strDate = "0" + strDate;
			    }
			  	var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
				return currentdate;
				}
			 
			 //品牌列表
			function getCarOemList(){
				var f = document.getElementById("getCarOemList");
				var type = "2";
				var flt = "";
				mui.ajax('../../../APP/vclList',{  
					//mui.ajax('../../../APP/vclList',{
				data:{param:'{"proVersion":"'+proversion+'","accountId":"'+accountid+'","sessionid":"'+sessionid+'","data":{"type":"'+type+'"}}'},
				dataType:'jsonp',//服务器返回json格式数据
				type:'post',//HTTP请求类型
				timeout:100000,//超时时间设置为10秒；
				success:function(data){
					var jsonObj = window.JSON.parse(data);
					if(jsonObj.resultcode=="1"){
						//获取返回数据的data
						var resultdata = jsonObj.data;
							flt+='<ul class="mui-table-view mui-table-view-chevron" style="margin-top:0px;">';;
							if(null !=resultdata){
								for(var m=0;m<resultdata.length;m++){
						  			//flt+='<li class="mui-table-view-cell  "><a class="" href="#"><span style="padding-left: 10px;">'+resultdata[m].gpname+':'+keyon+'/'+resultdata[m].vcllist.length+'<span></a></li>';
						  			flt+='<li class="mui-table-view-cell" id="'+resultdata[m].gpid+'" ><a style="padding-right:10px" href="#"><span>'+resultdata[m].gpname+'</span><span style="float:right;">'+resultdata[m].gpegnoncount+'/'+resultdata[m].gpcount+'</span></a></li>';		
									}
								}
						  			flt+='</ul>';
						  			document.getElementById("closeIsLoading").style.display="none";
								f.innerHTML=flt;
						}
						
					else{
						document.getElementById("closeIsLoading").style.display="none";
						f.innerHTML="请求出错!"+jsonObj;
					}
				},
				error:function(xhr,type,errorThrown){
					//异常处理；
					document.getElementById("closeIsLoading").style.display="none";
					f.innerHTML="error";
				}
			});
			}
				mui('#getCarOemList').on("tap","li",function(){
					if(null==this.getAttribute("id")||""==this.getAttribute("id")){
						return;
					}
					var oemid=this.getAttribute("id");
					window.webkit.messageHandlers.vclListDetail.postMessage(oemid);
				})
			</script>
</html>